home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 5
/
Gekikoh Dennoh Club Vol. 5 (Japan).7z
/
Gekikoh Dennoh Club Vol. 5 (Japan) (Track 01).bin
/
internet
/
tcppack
/
tcppackb.lzh
/
src
/
libnetwork
/
socket.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-24
|
9KB
|
503 lines
/*
* socket.c
*
* Copyright (C) 1994 First Class Technology.
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"tcpipdrv.h"
#include"network.h"
#include"socket.h"
_ti_func search_ti_entry (void);
/************************************************
* *
************************************************/
int
accept (int a, char * b, int * c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = (long)c;
return func (_TI_accept, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
bind (int a, char * b, int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
return func (_TI_bind, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
close_s (int a)
{
_ti_func func = search_ti_entry ();
if (func)
{
return func (_TI_close_s, (long *)a);
}
return -1;
}
/************************************************
* *
************************************************/
int
connect (int a, char *b, int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
return func (_TI_connect, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
listen (int a, int b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = b;
return func (_TI_listen, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
socket (int a, int b, int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = b;
arg[2] = c;
return func (_TI_socket, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
read_s (int a, char * b, int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
return func (_TI_read_s, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
recvfrom (int a, char * b, int c, int d, char * e, int *f)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[6];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
arg[3] = d;
arg[4] = (long)e;
arg[5] = (long)f;
return func (_TI_recvfrom, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
write_s (int a, char * b, int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
return func (_TI_write_s, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
sendto (int a, char * b, int c, int d, char * e, int f)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[6];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
arg[3] = d;
arg[4] = (long)e;
arg[5] = f;
return func (_TI_sendto, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
socklen (int a, int b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = b;
return func (_TI_socklen, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
getpeername (int a, char *b, int *c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = (long)c;
return func (_TI_getpeername, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
getsockname (int a, char * b, int *c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = (long)c;
return func (_TI_getsockname, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
setflush (int a, int b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = b;
return func (_TI_setflush, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
shutdown (int a, int b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = b;
return func (_TI_shutdown, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
sockkick (int a)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_sockkick, (long *)a);
return -1;
}
/************************************************
* *
************************************************/
int
usesock (int a)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_usesock, (long *)a);
return -1;
}
/************************************************
* *
************************************************/
int
recvchar (int a)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_recvchar, (long *)a);
return -1;
}
/************************************************
* *
************************************************/
int
recvline (int a, char * b, unsigned int c)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[3];
arg[0] = a;
arg[1] = (long)b;
arg[2] = c;
return func (_TI_recvline, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
rrecvchar (int a)
{
_ti_func func = search_ti_entry ();
if (func)
return func (_TI_rrecvchar, (long *)a);
return -1;
}
/************************************************
* *
************************************************/
int
seteol (int a, char * b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = (long)b;
return func (_TI_seteol, arg);
}
return -1;
}
/************************************************
* *
************************************************/
int
sockmode (int a, int b)
{
_ti_func func = search_ti_entry ();
if (func)
{
long arg[2];
arg[0] = a;
arg[1] = (long)b;
return func (_TI_sockmode, arg);
}
return -1;
}
/************************************************
* *
************************************************/
void
usflush (int a)
{
_ti_func func = search_ti_entry ();
if (func)
func (_TI_usflush, (long *)a);
return;
}
/************************************************
* *
************************************************/
char *
psocket (void *a)
{
_ti_func func = search_ti_entry ();
if (func)
return (char *)func (_TI_psocket, (long *)a);
return NULL;
}
/************************************************
* *
************************************************/
char *
sockerr (int a)
{
_ti_func func = search_ti_entry ();
if (func)
{
return (char *)func (_TI_sockerr, (long *)a);
}
return NULL;
}
/************************************************
* *
************************************************/
char *
sockstate (int a)
{
_ti_func func = search_ti_entry ();
if (func)
{
return (char *)func (_TI_sockstate, (long *)a);
}
return NULL;
}